package com.example.demoapp.brvah.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseProviderMultiAdapter;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.example.demoapp.brvah.bean.MultipleItemBean;
import com.example.demoapp.brvah.itemProvider.ArticleProvider;
import com.example.demoapp.brvah.itemProvider.VideoProvider;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class ProviderAdapter extends BaseProviderMultiAdapter<MultipleItemBean> {

    private final Context mContext;
    public static final int TYPE_ARTICLE = 1;
    public static final int TYPE_VIDEO = 2;
    public static final int TYPE_BANNER = 3;
    //适配器
    private BaseItemProvider<MultipleItemBean> articleProvider;
    private BaseItemProvider<MultipleItemBean> videoProvider;
    private BaseItemProvider<MultipleItemBean> informationProvider;
    private BaseItemProvider<MultipleItemBean> audioProvider;

    public ProviderAdapter(Context context,@Nullable List<MultipleItemBean> data) {
        super(data);
        articleProvider = new ArticleProvider();
        videoProvider = new VideoProvider();
        addItemProvider(articleProvider);
        addItemProvider(videoProvider);

        mContext = context;

    }
    @Override
    protected int getItemType(@NotNull List<? extends MultipleItemBean> list, int i) {
        return list.get(i).getItemType();
    }


}


